<!DOCTYPE html>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">

<head>
    <head th:include="include :: header"></head>
</head>

<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="role-form">
                <div class="select-list">
                    <ul>
                        <li>
                            规则编码：<input type="text" name="type"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
    <div th:include="include :: footer"></div>
    <script>
       var prefix ="/rule";
       $(function() {
           var options = {
               url: prefix + "/list",
               modalName: "规则列表",
               search: false,
               showExport: true,
               columns: [{
                   radio: true
               },
                   {
                       field : 'type',
                       title : '规则类型',
                       visible: true
                   },
                   {
                       field : 'description',
                       title : '规则描述',
                       visible: true
                   },
                   {
                       field : 'needParameterKey',
                       title : '是否需要KEY',
                       visible: true,
                       formatter: function(value, row, index) {
                           if (row.needParameterKey == true) {
                               return '<span class="label label-danger">是</span>';
                           } else  {
                               return '<span class="label label-success">否</span>';
                           }
                       }
                   },
                   {
                       field : 'parameterNum',
                       title : '参数个数',
                       visible: true
                   },
                   {
                       field : 'example',
                       title : '举例说明',
                       formatter: function(value, row, index) {
                           var actions = [];
                           actions.push("<div  style='width: 400px'>" +value + "</div>");
                           return actions.join('');
                       }
                   },


                  ]
           };
           $.table.init(options);
       });


    </script>
</body>

</html>
